﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.Threading;

namespace VentHost.Svc
{
    public partial class Service1 : ServiceBase
    {
        public Service1()
        {
            InitializeComponent();
        }

        Thread t;

        protected override void OnStart(string[] args)
        {            
            t = new Thread(new ThreadStart(CheckService));          

        }

        protected override void OnStop()
        {
            t.Abort();
        }

        private void CheckService()
        {
            bool IsRunning;
            using (VentHost.Lib.Service s = new VentHost.Lib.Service())
            {
                IsRunning = s.IsRunning();

            }
        }
    }
}
